<?php

$kthandle=@opendir('./');
while ($ktfile = @readdir($kthandle)) {
	if ( (!ereg("[.]",$ktfile)) AND (ereg("install",$ktfile)) ) {
		Header("Location:$ktfile/install.php");
		exit;
	}
}
@closedir($kthandle);
if (!file_exists("mainfile.php")) { exit(); }
define('NV_SYSTEM', true);
@require_once("mainfile.php");
$name = $Home_Module;
$home = 1;
$module_title = ""._HOMEPAGE."";
$modpath = '';


if (!isset($mop)) { $mop="modload"; }
if (!isset($mod_file)) { $mod_file="index"; }
$name = trim($name);
if (isset($file)) { $file = trim($file); }
$mod_file = trim($mod_file);
$mop = trim($mop);
if (stripos_clone($name,"..") || (isset($file) && stripos_clone($file,"..")) || stripos_clone($mod_file,"..") || stripos_clone($mop,"..")) {
	die("You are so cool...");
} else {
    $modpath .= "modules/$name/$mod_file.php";
    if (file_exists($modpath)) {
        include($modpath);
    } else {
        $index = 1;
        include("header.php");
        OpenTable();
        if (defined('IS_SPADMIN')) {
            echo "<center><font class=\"\"><b>"._HOMEPROBLEM."</b></font><br><br>[ <a href=\"".$adminfold."/".$adminfile.".php?op=modules\">"._ADDAHOME."</a> ]</center>";
        } else {
            echo "<center>"._HOMEPROBLEMUSER."</center>";
        }
        CloseTable();
        include("footer.php");
    }
}

?>